﻿using System;
using System.Linq;
using System.Linq.Expressions;

namespace DDD.Application
{
    public interface IBaseService<T> where T :class
    {
        T GetSingle(Expression<Func<T, bool>> exp = null);
        IQueryable<T> Find(Expression<Func<T, bool>> exp = null);
        IQueryable<T> Find(int pageindex = 1, int pagesize = 10,Expression<Func<T, bool>> exp = null);
        int GetCount(Expression<Func<T, bool>> exp = null);
        void Add(T entity);
        void Update(T entity);
        void Delete(T entity);
        void Update(Expression<Func<T, bool>> exp, T entity);
        void Delete(Expression<Func<T, bool>> exp);
    }
}